home *** CD-ROM | disk | FTP | other *** search
- script
-
- ; Online Order Entry System for BBS Express! ST
- ; written by Keith Ledbetter 14-Sept-87
- ; ---------------------------------------------
-
- abort off
-
- clear screen
- define Top_Of_Page ;item # at top of screen
- define Total_items
- define Instr ;generic input field
- define Count
- define Temp
- define Pointer ;generic pointer field
-
- define Text_Path = 'd:\bbsxdemo\oe\dat\' ;where the text is
- define orders_filename = 'd:\bbsxdemo\oe\dat\orders.dat' ;orders dataset
- define info_filename = 'd:\bbsxdemo\oe\dat\info.dat' ;info dataset
-
- define Allow_MasterCard = 'YES' ;change these to the <<--------
- define Allow_VISA = 'YES' ; credit cards you want to
- define Allow_AMExpress = 'YES' ; allow.. ('YES' or 'NO')
- define Allow_COD = 'YES' ; >>> NOTE: NOT IN USE YET!
-
- define Datafile ;the data file we're reading now
- define Return_To ;file to execute when done
-
- define product ;the product they are ordering
- define quantity ;quantity they want
- define name ;to ship to
- define address
- define city
- define state
- define zip_code
- define day_phone
- define night_phone
- define payment_type
- define acct_number ;(if charge)
- define exp_date ;card's expiration date
- define bank_name ;bank name
- define bank_number ;bank number (if Mastercard)
- define spec_instr ;special instructions
- define video_width = '&11' ;user's video width
- define current_time = '&23' ;timestamp
- define current_date = '&24' ;datestamp
- define price
- define already_asked ;already asked for info?
-
- [name] = &2 ;user's REAL name (from logon record)
- [address] = &4
- [city] = &5
- [state] = &6
- [zip_code] = &7
- [day_phone] = &8
- [night_phone] = &8
-
-
- ; Process the category selection
- ; ------------------------------
-
- get_category:
-
- [top_of_page] = 1 ; to top of file..
- clear screen
- clear table
- total_items = table_load ('[text_path]category.dat')
- if total_items = 0 then
- printe 'Sorry...that area is being built!'
- exit
- endif
-
- GC_main_loop:
- clear screen
- printe
- printe '--------------------------------------' center
- printe ' DEMO VERSION! MAY NOT BE UP TO DATE! ' center
- printe '--------------------------------------' center
- PRINTE
- printe '-------------------------------------' center
- printe ' # Product Category Selection ' center
- printe '-------------------------------------' center
-
- gosub get10_items ;get a page worth of data
-
-
- printe
- GC_re_get:
- print 'P)rev N)ext Q)uit #) To View: ' center
- input [instr] 2
- if [instr] = '' then
- increase [top_of_page] 10
- goto GC_main_loop
- ef [instr] = NUMERIC then
- goto get_cat_selection
- ef [instr] = 'N' then
- increase [top_of_page] 10
- goto GC_main_loop
- ef [instr] = 'P' then
- decrease [top_of_page] 10
- goto GC_main_loop
- ef [instr] = 'Q' then
- exit
- else
- goto GC_re_get
- endif
-
- get_cat_selection:
- if [instr] < 1
- goto GC_re_get
- ef [instr] > [total_items]
- goto GC_re_get
- endif
- datafile = table_get(instr)
- datafile = copy (datafile, 36, 12)
- top_of_page = 1 ; to top of file..
- goto process_items
-
-
-
- process_items:
-
- if file_exists ('[text_path][datafile]')
- else
- get_out:
- printe '\n\nSorry, that area is under construction!'
- print '\nPress return...'
- input [instr] 1
- leave:
- close
- goto Get_category
- endif
-
- total_items = table_load ('[text_path][datafile]')
-
- if [total_items] = 0
- goto get_out
- endif
-
- clear screen
-
- PI_main_loop:
- clear screen
- printe
- printe '-------------------------------------' center
- printe ' # Product Price ' center
- printe '-------------------------------------' center
-
- gosub get10_items ;get a page worth of data
-
-
- printe
- re_get:
- print 'P)rev N)ext Q)uit #) To View: ' center
- input [instr] 2
-
- if [instr] = '' then
- increase [top_of_page] 10
- goto PI_main_loop
- ef [instr] = NUMERIC then
- goto info
- ef [instr] = 'N' then
- increase [top_of_page] 10
- goto PI_main_loop
- ef [instr] = 'P' then
- decrease [top_of_page] 10
- goto PI_main_loop
- ef [instr] = 'Q' then
- goto leave
- else
- goto re_get
- endif
-
-
- info:
- if [instr] < 1
- goto re_get
- ef [instr] > [total_items]
- goto re_get
- endif
- instr = table_get (instr)
-
- if video_width = 40 then
- temp = copy (instr, 36, 12)
- else
- temp = copy (instr, 50, 12)
- endif
-
- if file_exists ('[text_path][temp]')
- clear screen
- view ('[text_path][temp]')
- else
- PrintE
- PrintE 'No info available on that product' center
- endif
- print '\n\n'
- if video_width = 40 then
- print '(O)rder (R)equest info (C)ont: ' center
- else
- print '(O)rder this product (R)equest info on this product (C)ont: ' center
- endif
-
- input [temp] 1
- if [temp] = 'O'
- goto go_order
- ef [temp] = 'R'
- goto go_info
- endif
- goto PI_main_loop
-
-
- go_order:
- product = copy (instr, 1, 26)
- price = copy (instr, 28, 6)
- goto Process_order
-
-
- go_info:
- product = copy (instr, 1, 26)
- price = copy (instr, 28, 6)
- goto Process_info
-
-
- get10_items:
- if [top_of_page] < 1 then
- [top_of_page] = 1
- endif
- set [pointer] = [top_of_page] + 9
- if [pointer] > [total_items] then
- set [top_of_page] = [total_items] - 9
- endif
- if [top_of_page] < 1 then
- [top_of_page] = 1
- endif
- set [pointer] = [top_of_page]
- set [count] = 1
- get10a:
- instr = table_get (pointer)
- if [instr] = '' then
- set [instr] = ' '
- expand [instr] 35
- endif
- instr = copy (instr, 1, 33)
- set [temp] = [pointer]
- if [temp] < 10
- set [temp] = ' [temp]'
- endif
- printe '[temp]. [instr]' center
- increase [pointer]
- increase [count]
- if [pointer] > [total_items] then
- printe
- printe '*** End of Products ***' Center
- ef [count] < 11 then
- goto get10a
- endif
- RETURN
-
-
- Process_Order:
- abort off
-
- clear screen
- printe '\n\nORDERING: [product]'
- printe ' PRICE: [price]\n'
-
- printe '\iNOTE:\o'
-
- if [video_width] = 40 then
- printe ' You MUST leave 2 valid voice numbers,'
- printe 'since we will validate this order by'
- printe ' a telephone call!'
- printe
- printe ' Credit Card Purchases REQUIRE a'
- printe ' $40 minimum order.!'
- printe
- printe ' IF THE ORDER FORM IS NOT TOTALLY'
- printe ' FILLED OUT, IT WILL BE IGNORED!'
- printe
- printe ' There is a $4.00 minimum shipping'
- printe ' charge on your total order.'
- printe
- printe ' You can ABORT this order at ANY time'
- printe 'by entering "ABORT" at the main prompt.'
- else
- printe 'You MUST leave 2 valid voice numbers, since we will'
- printe 'validate this order by a telephone call!'
- printe
- printe ' Credit Card Purchases REQUIRE a $40 minimum order.!'
- printe
- printe ' IF THE ORDER FORM IS NOT TOTALLY FILLED OUT, IT WILL BE IGNORED!'
- printe
- printe ' There is a $4.00 minimum shipping charge on your total order.'
- printe
- print ' You can ABORT this order at ANY time '
- printe 'by entering "ABORT" at the main prompt.'
- endif
-
- printe
- print 'Press <return> to fill out order form..'
-
- input [instr] 5
-
- if [instr] = 'abort'
- goto GO_done
- endif
-
- set [quantity] = '(not yet entered)'
- set [payment_type] = '(not yet entered)'
-
- GO_main:
- clear screen
- printe
- printe ' You MUST fill in all data that\vsays \"(not yet entered)\"'
- printe
- printe ' Product: [product]'
- printe ' Price: [price]'
- printe
- printe ' (A) Quantity : [quantity]'
- printe ' (B) Name : [name]'
- printe ' (C) Address : [address]'
- printe ' (D) City : [city]'
- printe ' (E) State : [state]'
- printe ' (F) Zip Code : [zip_code]'
- printe ' (G) Day Phone : [day_phone]'
- printe ' (H) Night Phone : [night_phone]'
- printe ' (I) Payment Type: [payment_type]'
- printe ' Acct. Num: [acct_number]'
- printe ' Expir. Date: [exp_date]'
- printe ' Bank Name : [bank_name]'
- printe ' Bank Number: [bank_number]'
- printe
- print 'Enter Letter to change, ABORT to exit,\vor OK to process this order: '
-
- input [instr] 5 noreturn
- printe
-
- if [instr] = 'abort'
- goto GO_done
- ef [instr] = 'OK'
- goto save_order
- ef [instr] = 'A'
- print 'Enter Order Quantity: '
- input [quantity] 2 noreturn
- ef [instr] = 'B'
- print 'Enter Your Name: '
- input [name] 25 noreturn
- ef [instr] = 'C'
- print 'Enter Address: '
- input [address] 25 noreturn
- ef [instr] = 'D'
- print 'Enter City: '
- input [city] 25 noreturn
- ef [instr] = 'E'
- print 'Enter State: '
- input [state] 25 noreturn
- ef [instr] = 'F'
- print 'Enter Zip_Code: '
- input [zip_code] 25 noreturn
- ef [instr] = 'G'
- printe ' Enter a telephone number where we'
- printe ' can reach you in the DAYTIME.'
- print ' -> '
- input [day_phone] 20 noreturn
- ef [instr] = 'H'
- printe ' Enter a telephone number where we'
- printe ' can reach you at NIGHT.'
- print ' -> '
- input [night_phone] 20 noreturn
- ef [instr] = 'I'
- gosub get_charge
- endif
-
- goto GO_main
-
-
-
- get_charge:
- printe
- printe ' Payment Type'
- printe
- printe ' 1. VISA'
- printe ' 2. Master Card'
- printe ' 3. COD ($2 additional)'
- printe
-
- reget_charge:
-
- print ' Selection: '
- input [instr] 1 noreturn
-
- if [instr] = '1' then
- set [payment_type] = 'VISA'
- ef [instr] = '2' then
- set [payment_type] = 'Master Card'
- ef [instr] = '3' then
- set [payment_type] = 'COD'
- set [acct_number] = 'Not needed'
- set [bank_name] = 'Not needed'
- set [bank_number] = 'Not needed'
- set [exp_date] = 'Not needed'
- RETURN
- else
- goto reget_charge
- endif
-
- printe
- printe 'Enter Your [payment_type] Number '
- print '-> '
- input [acct_number] 20 noreturn
-
- printe
- printe 'Enter the expiration date of your'
- print '[payment_type] card: '
- input [exp_date] 8 noreturn
-
- if [payment_type] = 'Master Card' then
- printe
- printe 'Enter the BANK NUMBER that appears'
- print 'on your [payment_type] card: '
- input [bank_number] 4 noreturn
- else
- set [bank_number] = 'Not needed'
- endif
-
- printe
- printe 'Enter the BANK NAME that appears'
- print 'on your [payment_type] card: '
- input [bank_name] 25 noreturn
- RETURN
-
-
-
- save_order:
-
- if [quantity] = '(not yet entered)' ;can't let them out
- goto GO_main ; without this stuff!
- ef [payment_type] = '(not yet entered)'
- goto GO_main
- endif
-
- printe
- printe
- printe 'Thank you for placing an order with us!'
- printe
- print 'Please wait while I record this...'
-
- open [orders_filename] append
- fprinte ; added 3jan93, r.s.
- fprinte ; added 3jan93, r.s.
- fprinte ; added 3jan93, r.s.
- fprinte ; added 3jan93, r.s.
- fprinte
- fprinte
- fprinte '-----------------------------------------------'
- fprinte ' Product : [product] [price]'
- fprinte ' Quantity : [quantity]'
- fprinte ' Placed at : [current_time] on [current_date]'
- fprinte ' User Number: &31'
- fprinte ' Name : [name]'
- fprinte ' Address : [address]'
- fprinte ' City : [city]'
- fprinte ' State : [state]'
- fprinte ' Zip Code : [zip_code]'
- fprinte ' Day Phone : [day_phone]'
- fprinte ' Night Phone: [night_phone]'
- fprinte ' Payment Type: [payment_type]'
- fprinte ' Acct. Num: [acct_number]'
- fprinte ' Expir. Date: [exp_date]'
- fprinte ' Bank Name : [bank_name]'
- fprinte ' Bank Number: [bank_number]'
-
- close
-
- printe 'done!'
- printe
- printe 'Your order has been processed...thanks!'
- printe
- print 'Press <return> to continue...'
- input [instr] 1
-
- GO_done:
- goto PI_Main_Loop ;back to browsing!
-
- Process_Info:
- abort off
- if already_asked = 'y' then ;already gave us their address
- goto add_on_info
- endif
-
- GI_main:
- clear screen
- printe
- printe ' Product: [product]'
- printe
- printe ' Product information will be sent to\vyou at the following address:'
- printe
- printe ' (A) Name : [name]'
- printe ' (B) Address : [address]'
- printe ' (C) City : [city]'
- printe ' (D) State : [state]'
- printe ' (E) Zip Code : [zip_code]'
- printe ' (F) Day Phone : [day_phone]'
- printe ' (G) Night Phone : [night_phone]'
- printe
- print 'Enter Letter to change, ABORT to exit,\vor OK to process: '
-
- input [instr] 5 noreturn
- printe
-
- if [instr] = 'abort'
- goto GI_done
- ef [instr] = 'OK'
- goto save_info
- ef [instr] = 'A'
- print 'Enter Your Name: '
- input [name] 25 noreturn
- ef [instr] = 'B'
- print 'Enter Address: '
- input [address] 25 noreturn
- ef [instr] = 'C'
- print 'Enter City: '
- input [city] 25 noreturn
- ef [instr] = 'D'
- print 'Enter State: '
- input [state] 25 noreturn
- ef [instr] = 'E'
- print 'Enter Zip_Code: '
- input [zip_code] 25 noreturn
- ef [instr] = 'F'
- printe ' Enter a telephone number where we'
- printe ' can reach you in the DAYTIME.'
- print ' -> '
- input [day_phone] 20 noreturn
- ef [instr] = 'G'
- printe ' Enter a telephone number where we'
- printe ' can reach you at NIGHT.'
- print ' -> '
- input [night_phone] 20 noreturn
- endif
-
- goto GI_main
-
- save_info:
-
- printe
- printe
- print 'Please wait while I record this...'
-
- open [info_filename] append
- fprinte
- fprinte
- fprinte '-----------------------------------------------'
- fprinte ' Product : [product]'
- fprinte ' Placed at : [current_time] on [current_date]'
- fprinte ' User Number: &31'
- fprinte ' Name : [name]'
- fprinte ' Address : [address]'
- fprinte ' City : [city]'
- fprinte ' State : [state]'
- fprinte ' Zip Code : [zip_code]'
- fprinte ' Day Phone : [day_phone]'
- fprinte ' Night Phone: [night_phone]'
-
- close
-
- printe 'done!'
- printe
- already_asked = 'y'
- printe 'Your request has been processed...thanks!'
- printe
- print 'Press <return> to continue...'
- input [instr] 1
-
- GI_done:
- goto PI_Main_Loop ;back to browsing!
-
- Add_on_Info:
- printe
- print 'Adding to your previous request...'
-
- open [info_filename] append
- fprinte ' ADDITIONAL: [product]'
- close
- printe 'done!'
- printe
- print 'Press <return> to continue...'
- input [instr] 1
- goto PI_Main_Loop ;back to browsing!
-
-